<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8"/>
    <title></title>
 <#include "/header.ftl">
</head>
<body>
<div id="app">
    <div>
        <el-table :data="tableData" stripe style="width: 100%">
            <el-table-column type="index" label="序号" width="180"></el-table-column>
            <el-table-column prop="course.courseName" label="课程名称"></el-table-column>
            <el-table-column prop="courseDelete" label="状态" :formatter="formatterState">
                <!-- {{deleteState == 1 ? '已完成':'未完成'}}--></el-table-column>
            <#--<el-table-column prop="scorePlay" label="课件点播分数"></el-table-column>-->
            <#--<el-table-column prop="scoreOntime" label="在线时间分数"></el-table-column>-->
            <#--<el-table-column prop="scoreTest" label="小结测试分数"></el-table-column>-->
            <el-table-column prop="scoreExam" label="课程结业考试分数"></el-table-column>
            <el-table-column prop="totalscore" label="总成绩">
                <template slot-scope="scope">
                    {{scope.row.scorePlay + scope.row.scoreOntime + scope.row.scoreTest + scope.row.scoreExam}}
                </template>
            </el-table-column>
        </el-table>
        <div class="block">
            <el-pagination
                    @current-change="handleCurrentChange"
                    :current-page.sync="pageIndex"
                    :page-size="pageSize"
                    layout="prev, pager, next, jumper"
                    :total="total">
            </el-pagination>
        </div>
    </div>
</div>
<#include "/footer.ftl">
<script>

    let _this = new Vue({
        el: '#app',
        data: {
            pageIndex: 1,
            pageSize: 5,
            total: 100,
            totalScore: 0,
            tableData: []
        },
        created: function () {
            this.getScoreMsg();
        },
        methods: {
            formatterState(row, column) {
                if (row.courseDelete == 1) {
                    return "未完成";
                } else {
                    return "已完成";
                }
            },
            handleSizeChange(val) {
            },
            handleCurrentChange(val) {
                this.pageIndex = val;
                this.getScoreMsg()
            },
            getScoreMsg: function () {

                $.ajax({
                    type: 'post',
                    url: '/api/student/listScore',
                    data: {pageIndex: this.pageIndex},
                    dataType: 'json',
                    success: function (res) {
                        _this.total = res.resData.total;
                        _this.pageSize = res.resData.pageSize;
                        _this.tableData = res.resData.list;
                    },
                    error: function (error) {
                        console.log('接口不通' + error);
                    }
                })
            }
        }
    })


</script>
</body>
</html>
